<?php
class IndexAction extends Action {
	public $username=NULL;
	public function _initialize(){
		import('@.Rex.autoLogin');
		$this->username=autoLogin::PC();
		$this->assign('us',$this->username);
	}
    public function index(){
    	$page=(int)$_GET['page'];
    	$page=(!$page)?1:$page;
		$list=M("video","vv_","DB_CONFIG1")->page($page, 12)->select();
		$this->assign('list',$list);
		
		$count=M("video","vv_","DB_CONFIG1")->query('select count(*) as c from vv_video');
		$count=(int)$count[0]['c'];
		$tpage=ceil($count/12);
		$this->assign('tp', $tpage);//total page
		$this->assign('cp', $page);//current page
		
		$this->display();
    }
}